<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>{:C('SERVER_NAME')}</title>
        <link rel="stylesheet" type="text/css" href="__PUBLICADMIN__/css/style.css">
    </head>
    <body>
        <div class="content p50">
            <div class="content-title"><h2>云曝光订单列表</h2></div>
            <div class="p20">
                <div class="search-box">
                    <form id="myform"  action="{:U('ExposureOrder/exposureOrderList')}" method="get" >
                        <!--                <span class="search-title">订单号：</span><span class="search fl"><input type="text" name="order_id" placeholder="订单号"></span> -->
                        <span class="search-title">用户名：</span><span class="search fl"><input type="text" name="username" value="{$Think.get.username}" placeholder="用户名"></span>
                        <span class="search-title">标题：</span><span class="search fl"><input type="text" name="exposure_content"  value="{$Think.get.exposure_content}" placeholder="内容"></span>
                        <span class="search-select" ><select name="status">
                                <option value="0" <if condition="$Think.get.status eq 0" > selected = "selected"</if>>未审核</option>
                                <option value="1" <if condition="$Think.get.status eq 1" > selected = "selected"</if>>已审核</option>
                            </select></span>
                        <a href="javascript:$('#myform').submit();"  class="search-btn fl"></a>
                    </form>
                </div>
                <table class="table">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>订单额</th>
                            <th>下单时间</th>
                            <th>内容</th>
                            <th>状态</th>
                            <th>完成情况</th>
                            <th>用户</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    <notempty  name="exposureOrder">
                        <volist name="exposureOrder" id="eo">
                            <tr>
                                <td>{$eo.id}</td>
                                <td>{$eo.price}</td>
                                <td>{$eo.add_time}</td>
                                <td>{$eo.exposure_content}</td>
                                <td><if condition="$eo.status eq 1" >已审核<else ifcondition="$eo.status eq 2"/>审核失败<else/>未审核</if></td>
                            <td><if condition="$eo.status eq 1" >已完成<else/>未完成</if></td>
                            <td>{$eo.username}</td>
                            <td><a href="javascript:;"  class='look2'>确定完成</a>|<a href="javascript:;"  id="{$eo.id}"   class='look'>详情</a></td>
                            </tr>
                        </volist>
                        <else/>
                        <tr><td colspan="8">暂无数据</td></tr>
                    </notempty >
                    </tbody>
                </table>
                <div class="page">
                    {$page}
                </div>
            </div>
        </div>	

    </div>

    <div class="look-box content" id="box">
        <div class="look-content">
            <div class="look-shut"><img src="__PUBLIC__/images/look-close.png"></div>
            <h2>我的曝光-查看</h2>
                
            <div class="form-group"><span class="form-title">曝光次数：</span><div class="form-content" id="type"></div></div>
            <div class="form-group"><span class="form-title">上传的图片：</span><div class="form-content" id="imgs">
                    
                </div></div>
            <div class="form-group"><span class="form-title">推送文案：</span><div class="form-content" id="content"></div></div>
            <div class="form-group"><span class="form-title">发布日期：</span><div class="form-content" id="addtime"></div></div>
            <div class="form-group"><span class="form-title">审核状态：</span><div class="form-content" id="status"></div></div>
            <div class="form-group"><span class="form-title">审核结果：</span><div class="form-content" id="result"></div></div>
        </div>
    </div>
 <div class="look-box  content" id="box2">
     <div class="look-content" style="width:400px">
            <div class="look-shut"><img src="__PUBLIC__/images/look-close.png"></div>
            <h2>我的曝光-确认完成</h2>
              <p>&nbsp;</p>
            <div class="form-group">反馈文件格式必须为zip、rar。</div>
            <form action="{:U('ExposureOrder/orderComplete')}" method="post"  enctype="multipart/form-data">
                  <p>&nbsp;</p>
                 <div class="form-group"><span class="form-title">反馈文件：</span><div class="form-content" id="content"><input type="file" name="userfile"></div></div>
               
                 <div class="content form-group"><input type="submit" value="完成" class="form-btn"></div>
            </form>
             </div>
    </div>
<include file="Public/ok" />
<include file="Public/okcancel" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="__PUBLICADMIN__/js/page.js"></script>
<script>

    //详情弹窗
    $(".p20").on("click", ".look", function () {
        id = $(this).attr("id");
        look(id);
        $("#box").fadeIn();
    })
    $(".look-shut").on("click", function () {
        $("#box").fadeOut();
    })
    //详情弹窗
    $(".p20").on("click", ".look2", function () {
        id = $(this).attr("id");
        
        $("#box2").fadeIn();
    })
    $(".look-shut").on("click", function () {
        $("#box2").fadeOut();
    })
    //查看详情
    function look(id)
    {
        $.ajax({
            type: 'POST',
            url: "{:U('ExposureOrder/exposureOrderById')}",
            data: {id: id},
            dataType: 'json',
            success: function (data) {
                if (data.status === 200) {
                    $("#type").text(data.info.package_name);
                    $("#content").text(data.info.exposure_content);
                    $("#status").text(data.info.status);
                    $("#imgs").text("");
                    for (var value in data.info.imgs) {
                        $("#imgs").append("<img src='/Uploads/" + (data.info.imgs)[value] + "'>");
                    }
                    $("#addtime").text(data.info.add_time);
                    $("#result").text(data.info.result);
                } else {
                    modelConfirm(msg.info);
                }
            },
            error: function (err) {
                modelConfirm(msg.info);
            }
        }, JSON);
    }
</script>	
</body>
</html>
